package com.qf.controller;

import com.qf.pojo.Account;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @ClassName AccountController
 * @Description TODO
 * @Author 86181
 * @Date 2022/9/3 11:58
 * @Version 1.0
 **/
@Controller
@RequestMapping("account")
public class AccountController {
    @RequestMapping(value = "findAccount",method = RequestMethod.GET)
    public String findAccount(){
        System.out.println("findAll执行了");
        return "success";
    }
    @RequestMapping(value = "addAccount",params = {"userName"})
    public String addAccount(){
        System.out.println("addAccount执行了....");
        return "success";
    }

    @RequestMapping(value = "addAccount01",params = {"userName=aa"})
    public String addAccount01(){
        System.out.println("addAccount01执行了");
        return "success";
    }

    @RequestMapping(value = "findAccountById")
    public String findAccountById(int id){
        System.out.println("findAccountById");
        System.out.println("id:"+id);
        return "success";
    }

    @RequestMapping(value = "findAccountByIdAndName")
    public String findAccountByIdAndName(int id , String name){
        System.out.println("findAccountByIdAndName");
        System.out.println("id:"+id);
        System.out.println("name:"+name);
        return "success";
    }

   @RequestMapping(value = "addNewAccount",method = RequestMethod.POST)
    public  String addNewAccount(Account account){
       System.out.println(account);
       System.out.println("addNewAccount执行了。。。。。。");
        return "success";
    }


}
